CREATE TABLE [dbo].[Relation_spec_fac]
(
[ik_spec_fac] [int] NOT NULL IDENTITY(1, 1),
[ik_spec] [int] NOT NULL,
[ik_fac] [int] NOT NULL,
[YearObuch] [int] NULL,
[ik_rule] [int] NULL,
[Ik_form_ed] [int] NULL,
[ik_kat_zaved] [int] NOT NULL CONSTRAINT [DF__Relation___ik_ka__5441852A] DEFAULT ((4))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Relation_spec_fac] ADD CONSTRAINT [PK_Relation_spec_fac] PRIMARY KEY CLUSTERED  ([ik_spec_fac]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Relation_spec_fac] ADD CONSTRAINT [IX_Relation_spec_fac] UNIQUE NONCLUSTERED  ([ik_spec], [ik_fac]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Relation_spec_fac] WITH NOCHECK ADD CONSTRAINT [FK_Relation_spec_fac_Fac] FOREIGN KEY ([ik_fac]) REFERENCES [dbo].[Fac] ([Ik_fac])
GO
ALTER TABLE [dbo].[Relation_spec_fac] ADD CONSTRAINT [FK_Relation_spec_fac_Form_ed] FOREIGN KEY ([Ik_form_ed]) REFERENCES [dbo].[Form_ed] ([Ik_form_ed])
GO
ALTER TABLE [dbo].[Relation_spec_fac] WITH NOCHECK ADD CONSTRAINT [FK_Relation_spec_fac_Spec_stud] FOREIGN KEY ([ik_spec]) REFERENCES [dbo].[Spec_stud] ([ik_spec])
GO
